/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package pt.iasd.youthshelter.pathfinder.nodes;

import java.util.List;
import org.openide.nodes.Children;
import org.openide.nodes.Node;
import pt.iasd.youthshelter.datamodel.Pathfinder;

/**
 *
 * @author Rui
 */
public class PathfinderChildren extends Children.Keys<Pathfinder> {
    private List<Pathfinder> pathfinders;

    public PathfinderChildren(List<Pathfinder> pathfinders) {
        this.pathfinders = pathfinders;
    }

    @Override
    protected Node[] createNodes(Pathfinder key) {
        return new Node[]{new PathfinderNode(key)};
    }

    @Override
    protected void addNotify() {
        if(pathfinders != null) {
            setKeys(pathfinders);
        }
    }
}
